package com.sypk.exception;

public class BaseException extends Exception {

    private static final long serialVersionUID = -7140905113256495821L;
    
    protected String errKey = "";
	protected String errMsg = "";
	
	public BaseException() {
		super();
	}
	
	public BaseException(String errKey) {
		super(errKey);
		this.errKey = errKey;
		this.errMsg = ErrorCodeManager.getErrorMsg(this.errKey);
	}

	public BaseException(String errKey, String errMsg) {
		super(errKey);
		this.errKey = errKey;
		this.errMsg = errMsg;
	}
  
	public BaseException(String errKey, Throwable throwable) {  
	    super(errKey, throwable);  
		this.errKey = errKey;
		this.errMsg = ErrorCodeManager.getErrorMsg(this.errKey);
	}  

	public String setKey(String errKey) {
		return this.errKey = errKey;
	}
	
	public String getKey() {
		return this.errKey;
	}

	public String setMessage(String errMsg) {
		return this.errMsg = errMsg;        
	}
	
	public String getMessage() {
		return this.errMsg;        
	}

}
